home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1035
/
1035.xpi
/
chrome
/
1clickweather.jar
/
content
/
1clickweather
/
js
/
config
/
userconfig.js
< prev
Wrap
Text File
|
2010-01-19
|
35KB
|
1,096 lines
// � 2005 The Weather Channel Interactive, Inc. All Rights Reserved.
/***************************************
UserConfig - Manager object for
user configuration
****************************************/
function UserConfig() {
this.fileManager = new FileManager();
this.info = new UserConfigInfo();
this.allProfiles = new UserConfigProfilesArray();
// tell the filemanager to "fix" the user config files if needed
//this.fileManager.updateUserConfigFiles();
}
UserConfig.prototype = {
fileManager : null,
info : null,
allProfiles : null,
// THIS METHOD LOADS DATA
// FROM CONFIG XML
load : function() {
var myDOM;
try {
myDOM = this.fileManager.getUserConfigDOM();
var rootElement = myDOM.getElementsByTagName("userconfig")[0];
// get the info element
var infoElement = rootElement.getElementsByTagName("info")[0];
this.info.setVersion(infoElement.getElementsByTagName("version")[0].firstChild.nodeValue);
this.info.setLastUpdate(infoElement.getElementsByTagName("lastupdate")[0].firstChild.nodeValue);
this.info.setIsInitial(infoElement.getElementsByTagName("initial")[0].firstChild.nodeValue);
// load userid from config file
this.info.setUserId(infoElement.getElementsByTagName("userid")[0].firstChild.nodeValue);
// load dut (daily user tracking) value
this.info.setLastDUT(infoElement.getElementsByTagName("lastDUT")[0].firstChild.nodeValue);
var allProfilesElement = rootElement.getElementsByTagName("profiles")[0].getElementsByTagName("profile");
var a = 0;
for(a = 0;a < allProfilesElement.length;a++) {
var nextProfNode = allProfilesElement[a];
var nextProfile = new UserConfigProfile();
nextProfile.setID(nextProfNode.getAttribute("id"));
nextProfile.setIsEnabled(nextProfNode.getAttribute("enabled"));
nextProfile.setIsDefault(nextProfNode.getAttribute("default"));
var locationNode = nextProfNode.getElementsByTagName("setup")[0].getElementsByTagName("location")[0];
var unitsNode = nextProfNode.getElementsByTagName("setup")[0].getElementsByTagName("units")[0];
var positionNode = nextProfNode.getElementsByTagName("setup")[0].getElementsByTagName("position")[0];
var currentCondNode = nextProfNode.getElementsByTagName("currentconditions")[0];
var fcstNode = nextProfNode.getElementsByTagName("forecast")[0];
var extFcstNode = nextProfNode.getElementsByTagName("extforecast")[0];
var videoNode = nextProfNode.getElementsByTagName("video")[0];
var radarNode = nextProfNode.getElementsByTagName("radar")[0];
var sateliteNode = nextProfNode.getElementsByTagName("satelite")[0];
var lifestyleNode = nextProfNode.getElementsByTagName("lifestyle")[0];
nextProfile.getSetup().getLocation().setLocID(locationNode.getElementsByTagName("locid")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setLocType(locationNode.getElementsByTagName("loctype")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setLocPres(locationNode.getElementsByTagName("locpres")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setIsUS(locationNode.getElementsByTagName("isus")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setState(locationNode.getElementsByTagName("state")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setCountry(locationNode.getElementsByTagName("country")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setTimezone(locationNode.getElementsByTagName("timezone")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setObsID(locationNode.getElementsByTagName("obsid")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setFcstID(locationNode.getElementsByTagName("fcstid")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setIsInDST(locationNode.getElementsByTagName("isindst")[0].firstChild.nodeValue);
nextProfile.getSetup().getLocation().setGMTDiff(locationNode.getElementsByTagName("gmtdiff")[0].firstChild.nodeValue);
nextProfile.getSetup().getUnits().setName(unitsNode.getAttribute("name"));
nextProfile.getSetup().setPosition(positionNode.getAttribute("type"));
nextProfile.getCurrentCond().setIsEnabled(currentCondNode.getAttribute("enabled"));
nextProfile.getCurrentCond().setType(currentCondNode.getAttribute("type"));
nextProfile.getCurrentCond().getToolTip().setIsEnabled(currentCondNode.getElementsByTagName("tooltip")[0].getAttribute("enabled"));
nextProfile.getCurrentCond().getToolTip().setType(currentCondNode.getElementsByTagName("tooltip")[0].getAttribute("type"));
nextProfile.getCurrentCond().getAlerts().setType(currentCondNode.getElementsByTagName("alerts")[0].getAttribute("type"));
nextProfile.getCurrentCond().getAlerts().setInterval(currentCondNode.getElementsByTagName("alerts")[0].getAttribute("interval"));
nextProfile.getCurrentCond().getAlerts().setIsEnabled(currentCondNode.getElementsByTagName("alerts")[0].getAttribute("enabled"));
nextProfile.getForecast().setIsEnabled(fcstNode.getAttribute("enabled"));
nextProfile.getForecast().setType(fcstNode.getAttribute("type"));
nextProfile.getForecast().getToolTip().setIsEnabled(fcstNode.getElementsByTagName("tooltip")[0].getAttribute("enabled"));
nextProfile.getForecast().getToolTip().setType(fcstNode.getElementsByTagName("tooltip")[0].getAttribute("type"));
nextProfile.getForecast().setForecastSwitch(fcstNode.getElementsByTagName("forecastswitch")[0].firstChild.nodeValue);
nextProfile.getExtForecast().setIsEnabled(extFcstNode.getAttribute("enabled"));
nextProfile.getExtForecast().setType(extFcstNode.getAttribute("type"));
nextProfile.getExtForecast().getExtDetails().setDays(extFcstNode.getElementsByTagName("details")[0].getAttribute("days"));
nextProfile.getExtForecast().getExtDetails().setTime(extFcstNode.getElementsByTagName("details")[0].getAttribute("time"));
nextProfile.getExtForecast().getToolTip().setIsEnabled(extFcstNode.getElementsByTagName("tooltip")[0].getAttribute("enabled"));
nextProfile.getExtForecast().getToolTip().setType(extFcstNode.getElementsByTagName("tooltip")[0].getAttribute("type"));
nextProfile.getVideo().setIsEnabled(videoNode.getAttribute("enabled"));
nextProfile.getVideo().setID(videoNode.getAttribute("id"));
nextProfile.getRadar().setIsEnabled(radarNode.getAttribute("enabled"));
nextProfile.getRadar().setID(radarNode.getAttribute("id"));
nextProfile.getSatelite().setIsEnabled(sateliteNode.getAttribute("enabled"));
nextProfile.getSatelite().setID(sateliteNode.getAttribute("id"));
nextProfile.getLifeStyle().setIsEnabled(lifestyleNode.getAttribute("enabled"));
var allLinks = lifestyleNode.getElementsByTagName("links")[0].getElementsByTagName("link");
var b=0;
for(b=0;b<allLinks.length;b++) {
nextProfile.getLifeStyle().addLink(allLinks[b].getAttribute("id"));
}
this.allProfiles.addProfile(nextProfile);
}
} catch(e) {
alert(e);
}
},
// THIS METHOD WRITES DATA
// TO CONFIG XML
save : function() {
try {
this.fileManager.saveUserConfigToFile(this.toDOM());
} catch(e) {
alert(e);
}
},
// THIS METHOD TRANSFORMS THIS OBJECT
// TO XML DOM
toDOM : function() {
var xmlDoc = document.implementation.createDocument("", "", null);
var rootElement = xmlDoc.createElement("userconfig");
var info = xmlDoc.createElement("info");
var infoVersion = xmlDoc.createElement("version");
// make sure the version is the latest one!
if(this.getInfo().getVersion() != '1.1.9.1') {
infoVersion.appendChild(xmlDoc.createTextNode('1.1.9.1'));
} else {
infoVersion.appendChild(xmlDoc.createTextNode(this.getInfo().getVersion()));
}
// lastupdate
var infoLastUpdate = xmlDoc.createElement("lastupdate");
infoLastUpdate.appendChild(xmlDoc.createTextNode(this.getInfo().getLastUpdate()));
// initial
var infoInitial = xmlDoc.createElement("initial");
infoInitial.appendChild(xmlDoc.createTextNode(this.getInfo().getIsInitial()));
// this line of code write userId code
var infoUserIdElement = xmlDoc.createElement("userid");
infoUserIdElement.appendChild(xmlDoc.createTextNode(this.getInfo().getUserId()));
// write DUT (daily user tracking) value
var dailyUserTracking = xmlDoc.createElement("lastDUT");
dailyUserTracking.appendChild(xmlDoc.createTextNode(this.getInfo().getLastDUT()));
info.appendChild(infoVersion);
info.appendChild(infoLastUpdate);
info.appendChild(infoInitial);
info.appendChild(infoUserIdElement);
info.appendChild(dailyUserTracking);
rootElement.appendChild(info);
var allprofiles = xmlDoc.createElement("profiles");
var profs = this.allProfiles.getAll();
for(var nextProfKey in profs) {
var nextProf = profs[nextProfKey];
var nextProfElement = xmlDoc.createElement("profile");
nextProfElement.setAttribute("id", nextProf.getID());
nextProfElement.setAttribute("enabled", nextProf.getIsEnabled());
nextProfElement.setAttribute("default", nextProf.getIsDefault());
var nextProfConfigElement = xmlDoc.createElement("setup");
var nextProfConfigLocationElement = xmlDoc.createElement("location");
var locidElement = xmlDoc.createElement("locid");
locidElement.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getLocID()));
nextProfConfigLocationElement.appendChild(locidElement);
var loctypeElement = xmlDoc.createElement("loctype");
loctypeElement.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getLocType()));
nextProfConfigLocationElement.appendChild(loctypeElement);
var locpresElement = xmlDoc.createElement("locpres");
locpresElement.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getLocPres()));
nextProfConfigLocationElement.appendChild(locpresElement);
var locisus = xmlDoc.createElement("isus");
locisus.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getIsUS()));
nextProfConfigLocationElement.appendChild(locisus);
var locstate = xmlDoc.createElement("state");
locstate.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getState()));
nextProfConfigLocationElement.appendChild(locstate);
var loccountry = xmlDoc.createElement("country");
loccountry.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getCountry()));
nextProfConfigLocationElement.appendChild(loccountry);
var loctimezone = xmlDoc.createElement("timezone");
loctimezone.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getTimezone()));
nextProfConfigLocationElement.appendChild(loctimezone);
var locobsid = xmlDoc.createElement("obsid");
locobsid.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getObsID()));
nextProfConfigLocationElement.appendChild(locobsid);
var locfcstid = xmlDoc.createElement("fcstid");
locfcstid.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getFcstID()));
nextProfConfigLocationElement.appendChild(locfcstid);
var locdst = xmlDoc.createElement("isindst");
locdst.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getIsInDST()));
nextProfConfigLocationElement.appendChild(locdst);
var locgmt = xmlDoc.createElement("gmtdiff");
locgmt.appendChild(xmlDoc.createTextNode(nextProf.getSetup().getLocation().getGMTDiff()));
nextProfConfigLocationElement.appendChild(locgmt);
nextProfConfigElement.appendChild(nextProfConfigLocationElement);
var nextProfUnitsElement = xmlDoc.createElement("units");
nextProfUnitsElement.setAttribute("name", nextProf.getSetup().getUnits().getName());
var nextProfPositionElement = xmlDoc.createElement("position");
nextProfPositionElement.setAttribute("type", nextProf.getSetup().getPosition());
nextProfConfigElement.appendChild(nextProfUnitsElement);
nextProfConfigElement.appendChild(nextProfPositionElement);
var currentCondElement = xmlDoc.createElement("currentconditions");
currentCondElement.setAttribute("enabled", nextProf.getCurrentCond().getIsEnabled());
currentCondElement.setAttribute("type", nextProf.getCurrentCond().getType());
var currentCondTooltipElement = xmlDoc.createElement("tooltip");
currentCondTooltipElement.setAttribute("enabled", nextProf.getCurrentCond().getToolTip().getIsEnabled());
currentCondTooltipElement.setAttribute("type", nextProf.getCurrentCond().getToolTip().getType());
currentCondElement.appendChild(currentCondTooltipElement);
var currentCondAlertsElement = xmlDoc.createElement("alerts");
currentCondAlertsElement.setAttribute("type", nextProf.getCurrentCond().getAlerts().getType());
currentCondAlertsElement.setAttribute("interval", nextProf.getCurrentCond().getAlerts().getInterval());
currentCondAlertsElement.setAttribute("enabled", nextProf.getCurrentCond().getAlerts().getIsEnabled());
currentCondElement.appendChild(currentCondAlertsElement);
nextProfConfigElement.appendChild(currentCondElement);
var forecastElement = xmlDoc.createElement("forecast");
forecastElement.setAttribute("enabled", nextProf.getForecast().getIsEnabled());
forecastElement.setAttribute("type", nextProf.getForecast().getType());
var fcstCondForecastSwitchElement = xmlDoc.createElement("forecastswitch");
fcstCondForecastSwitchElement.appendChild(xmlDoc.createTextNode(nextProf.getForecast().getForecastSwitch()));
forecastElement.appendChild(fcstCondForecastSwitchElement);
var fcstCondTooltipElement = xmlDoc.createElement("tooltip");
fcstCondTooltipElement.setAttribute("enabled", nextProf.getForecast().getToolTip().getIsEnabled());
fcstCondTooltipElement.setAttribute("type", nextProf.getForecast().getToolTip().getType());
forecastElement.appendChild(fcstCondTooltipElement);
nextProfConfigElement.appendChild(forecastElement);
var extForecastElement = xmlDoc.createElement("extforecast");
extForecastElement.setAttribute("enabled", nextProf.getExtForecast().getIsEnabled());
extForecastElement.setAttribute("type", nextProf.getExtForecast().getType());
var extForecastTooltipElement = xmlDoc.createElement("tooltip");
extForecastTooltipElement.setAttribute("enabled", nextProf.getExtForecast().getToolTip().getIsEnabled());
extForecastTooltipElement.setAttribute("type", nextProf.getExtForecast().getToolTip().getType());
extForecastElement.appendChild(extForecastTooltipElement);
var extForecastDetailElement = xmlDoc.createElement("details");
extForecastDetailElement.setAttribute("days", nextProf.getExtForecast().getExtDetails().getDays());
extForecastDetailElement.setAttribute("time", nextProf.getExtForecast().getExtDetails().getTime());
extForecastElement.appendChild(extForecastDetailElement);
nextProfConfigElement.appendChild(extForecastElement);
var videoElement = xmlDoc.createElement("video");
videoElement.setAttribute("enabled", nextProf.getVideo().getIsEnabled());
videoElement.setAttribute("id", nextProf.getVideo().getID());
nextProfConfigElement.appendChild(videoElement);
var radarElement = xmlDoc.createElement("radar");
radarElement.setAttribute("enabled", nextProf.getRadar().getIsEnabled());
radarElement.setAttribute("id", nextProf.getRadar().getID());
nextProfConfigElement.appendChild(radarElement);
var sateliteElement = xmlDoc.createElement("satelite");
sateliteElement.setAttribute("enabled", nextProf.getSatelite().getIsEnabled());
sateliteElement.setAttribute("id", nextProf.getSatelite().getID());
nextProfConfigElement.appendChild(sateliteElement);
var lifestyleElement = xmlDoc.createElement("lifestyle");
lifestyleElement.setAttribute("enabled", nextProf.getLifeStyle().getIsEnabled());
var linksElement = xmlDoc.createElement("links");
var allLinks = nextProf.getLifeStyle().getLinks();
for(var newLink in allLinks) {
var newLinkElement = xmlDoc.createElement("link");
newLinkElement.setAttribute("id", newLink);
linksElement.appendChild(newLinkElement);
}
lifestyleElement.appendChild(linksElement);
nextProfConfigElement.appendChild(lifestyleElement);
nextProfElement.appendChild(nextProfConfigElement);
allprofiles.appendChild(nextProfElement);
}
rootElement.appendChild(allprofiles);
// add the root element!
xmlDoc.appendChild(rootElement);
return xmlDoc;
},
// THIS METHOD TRANSFORMS THIS OBJECT
// TO XML STRING
toXMLString : function() {
var myDOM = this.toDOM();
return myDOM.xml;
},
getInfo : function() {
return this.info;
},
setInfo : function(myInfo) {
this.info = myInfo;
},
getAllProfiles : function() {
return this.allProfiles;
},
setAllProfile : function(myProfiles) {
this.allProfiles = myProfiles;
}
};
/*************************************
UserConfigInfo - Includes info
on this userconfig object
*************************************/
function UserConfigInfo() {
}
UserConfigInfo.prototype = {
version : null,
lastupdate : null,
initial : null,
userid : null,
lastDUT: null,
setVersion : function(myVersion) {
this.version = myVersion;
},
getVersion : function() {
return this.version;
},
setLastUpdate : function(myLastUpdate) {
this.lastupdate = myLastUpdate;
},
getLastUpdate : function() {
return this.lastupdate;
},
setIsInitial : function(myIsInitial) {
this.initial = myIsInitial;
},
getIsInitial : function() {
return this.initial;
},
getUserId : function(){
return this.userid;
},
setUserId : function(myUserId){
this.userid = myUserId;
},
/*
*
*
* Represent getter and setter last daily user tracking (DUT) value. This value is stored on userconfig xml file.
*
*/
getLastDUT : function(){
return this.lastDUT;
},
setLastDUT : function(value){
this.lastDUT = value;
}
};
/*************************************************
UserConfigProfilesArray - Includes profile info
array of this userconfig object
**************************************************/
function UserConfigProfilesArray() {
this.allProfiles = {};
}
UserConfigProfilesArray.prototype = {
allProfiles : null,
addProfile : function(newProfile) {
this.allProfiles[newProfile.getID()] = newProfile;
},
getDefaultProfile : function() {
return this.allProfiles["default"];
},
setDefaultProfile : function(defaultProfileID) {
this.allProfiles["default"] = defaultProfileID;
},
getProfile : function(profileID) {
return this.allProfiles[profileID];
},
getAll : function() {
return this.allProfiles;
}
};
/*************************************************
UserConfigProfile - Includes profile info
of this userconfig object
**************************************************/
function UserConfigProfile(){
this.setup = new UserConfigSetup();
this.currentcond = new UserConfigCurrentCond();
this.forecast = new UserConfigForecast();
this.extforecast = new UserConfigExtForecast();
this.video = new UserConfigVideo();
this.radar = new UserConfigRadar();
this.satelite = new UserConfigSatelite();
this.lifestyle = new UserConfigLifeStyle();
};
UserConfigProfile.prototype = {
id : null,
enabled : null,
isdefault : null,
setup : null,
currentcond : null,
forecast : null,
extforecast : null,
video : null,
radar : null,
satelite : null,
lifestyle : null,
getID : function() {
return this.id;
},
setID : function(myID) {
this.id = myID;
},
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getIsDefault : function() {
return this.isdefault;
},
setIsDefault : function(myIsDefault) {
this.isdefault = myIsDefault;
},
getSetup : function() {
return this.setup;
},
setSetup : function(mySetup) {
this.setup = mySetup;
},
getCurrentCond : function() {
return this.currentcond;
},
setCurrentCond : function(myCurrentCond) {
this.currentcond = myCurrentCond;
},
getForecast : function() {
return this.forecast;
},
setForecast : function(myForecast) {
this.forecast = myForecast;
},
getExtForecast : function() {
return this.extforecast;
},
setExtForecast : function(myExtForecast) {
this.extforecast = myExtForecast;
},
getVideo : function() {
return this.video;
},
setVideo : function(myVideo) {
this.video = myVideo;
},
getRadar : function() {
return this.radar;
},
setRadar : function(myRadar) {
this.radar = myRadar;
},
getSatelite : function() {
return this.satelite;
},
setSatelite : function(mySatelite) {
this.satelite = mySatelite;
},
getLifeStyle : function() {
return this.lifestyle;
},
setLifeStyle : function(myLifeStyle) {
this.lifestyle = myLifeStyle;
}
};
/***************************************
UserconfigSetup - contains user
config setup info for a profile
***************************************/
function UserConfigSetup() {
this.location = new UserConfigSetupLocation();
this.units = new UserConfigSetupUnits();
this.position = "";
}
UserConfigSetup.prototype = {
location : null,
units : null,
position : null,
getLocation : function() {
return this.location;
},
setLocation : function(myLocation) {
this.location = myLocation;
},
getUnits : function() {
return this.units;
},
setUnits : function(myUnits) {
this.units = myUnits;
},
getPosition : function() {
return this.position;
},
setPosition : function(myPosition) {
this.position = myPosition;
}
};
/*********************************************
UserconfigSetupLocation - contains user
config setup location info for a profile
*********************************************/
function UserConfigSetupLocation() {
}
UserConfigSetupLocation.prototype = {
locid : null,
loctype : null,
locpres : null,
isus : null,
state: null,
country : null,
timezone : null,
obsid : null,
fcstid : null,
isindst : null,
gmtdiff : null,
getObsID : function() {
return this.obsid;
},
setObsID : function(myObsID) {
this.obsid = myObsID;
},
getFcstID : function() {
return this.fcstid;
},
setFcstID : function(myFcstID) {
this.fcstid = myFcstID;
},
getIsInDST : function() {
return this.isindst;
},
setIsInDST : function(myIsInDST) {
this.isindst = myIsInDST;
},
getGMTDiff : function() {
return this.gmtdiff;
},
setGMTDiff : function(myGMTDiff) {
this.gmtdiff = myGMTDiff;
},
getLocID : function() {
return this.locid;
},
setLocID : function(myLocID) {
this.locid = myLocID;
},
getLocType : function() {
return this.loctype;
},
setLocType : function(myLocType) {
this.loctype = myLocType;
},
getLocPres : function() {
return this.locpres;
},
setLocPres : function(myLocPres) {
this.locpres = myLocPres;
},
getIsUS : function() {
return this.isus;
},
setIsUS : function(myIsUS) {
this.isus = myIsUS;
},
getState : function() {
return this.state;
},
setState : function(myState) {
this.state = myState;
},
getCountry : function() {
return this.country;
},
setCountry : function(myCountry) {
this.country = myCountry;
},
getTimezone : function() {
return this.timezone;
},
setTimezone : function(myTimezone) {
this.timezone = myTimezone;
}
};
/*********************************************
UserconfigSetupUnits - contains user
config setup units info for a profile
*********************************************/
function UserConfigSetupUnits() {
}
UserConfigSetupUnits.prototype = {
name : null,
//temperature : null,
//pressure : null,
//distance : null,
//precipitation : null,
//speed : null,
getName : function() {
return this.name;
},
setName : function(myName) {
this.name = myName;
}//,
//getTemperature : function() {
// return this.temperature;
//},
//setTemperature : function(myTemperature) {
// this.temperature = myTemperature;
//},
//getPressure : function() {
// return this.pressure;
//},
//setPressure : function(myPressure) {
// this.pressure = myPressure;
//},
//getDistance : function() {
// return this.distance;
//},
//setDistance : function(myDistance) {
// this.distance = myDistance;
//},
//getPrecipitation : function() {
// return this.precipitation;
//},
//setPrecipitation : function(myPrecipitation) {
// this.precipitation = myPrecipitation;
//},
//getSpeed : function() {
// return this.precipitation;
//},
//setSpeed : function(mySpeed) {
// this.speed = mySpeed;
//}
};
/*********************************************
UserConfigCurrentCond - contains user
current cond info for a profile
*********************************************/
function UserConfigCurrentCond() {
this.tooltip = new Tooltip();
this.alerts = new Alerts();
}
UserConfigCurrentCond.prototype = {
tooltip : null,
alerts : null,
enabled : null,
type : null,
getToolTip : function() {
return this.tooltip;
},
setToolTip : function(myTooltip) {
this.tooltip = myTooltip;
},
getAlerts : function() {
return this.alerts;
},
setAlerts : function(myAlerts) {
this.alerts = myAlerts;
},
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getType : function() {
return this.type;
},
setType : function(myType) {
this.type = myType;
}
};
/*********************************************
Tooltip - contains user
tooltip info for a profile
*********************************************/
function Tooltip() {
}
Tooltip.prototype = {
enabled : null,
type : null,
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getType : function() {
return this.type;
},
setType : function(myType) {
this.type = myType;
}
};
/*********************************************
Alerts - contains user
alerts info for a profile
*********************************************/
function Alerts() {
}
Alerts.prototype = {
interval : null,
type : null,
enabled : null,
getInterval : function() {
return this.interval;
},
setInterval : function(myInterval) {
this.interval = myInterval;
},
getType : function() {
return this.type;
},
setType : function(myType) {
this.type = myType;
},
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
}
};
/*********************************************
UserConfigForecast - contains user
forecast info for a profile
*********************************************/
function UserConfigForecast() {
this.tooltip = new Tooltip();
}
UserConfigForecast.prototype = {
tooltip : null,
forecastswitch : null,
enabled : null,
type : null,
getToolTip : function() {
return this.tooltip;
},
setToolTip : function(myTooltip) {
this.tooltip = myTooltip;
},
getForecastSwitch : function() {
return this.forecastswitch;
},
setForecastSwitch : function(myForecastSwitch) {
this.forecastswitch = myForecastSwitch;
},
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getType : function() {
return this.type;
},
setType : function(myType) {
this.type = myType;
}
};
/*********************************************
UserConfigExtForecast - contains user
ext forecast info for a profile
*********************************************/
function UserConfigExtForecast() {
this.tooltip = new Tooltip();
this.extDetails = new UserConfigExtForecastDetails();
};
UserConfigExtForecast.prototype = {
extDetails : null,
enabled : null,
type : null,
tooltip : null,
getToolTip : function() {
return this.tooltip;
},
setToolTip : function(myTooltip) {
this.tooltip = myTooltip;
},
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getType : function() {
return this.type;
},
setType : function(myType) {
this.type = myType;
},
getExtDetails : function() {
return this.extDetails;
}
};
/*********************************************
UserConfigExtForecastDetails - contains user
ext forecast details info for a profile
*********************************************/
function UserConfigExtForecastDetails() {
}
UserConfigExtForecastDetails.prototype = {
days : null,
time : null,
getDays : function() {
return this.days;
},
setDays : function(myDays) {
this.days = myDays;
},
getTime : function() {
return this.time;
},
setTime : function(myTime) {
this.time = myTime;
}
};
/*****************************
UserConfigVideo
******************************/
function UserConfigVideo() {
}
UserConfigVideo.prototype = {
enabled : null,
id : null,
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getID : function() {
return this.id;
},
setID : function(myID) {
this.id = myID;
}
};
/*****************************
UserConfigRadar
******************************/
function UserConfigRadar() {
}
UserConfigRadar.prototype = {
enabled : null,
id : null,
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getID : function() {
return this.id;
},
setID : function(myID) {
this.id = myID;
}
};
/*****************************
UserConfigSatelite
******************************/
function UserConfigSatelite() {
}
UserConfigSatelite.prototype = {
enabled : null,
id : null,
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getID : function() {
return this.id;
},
setID : function(myID) {
this.id = myID;
}
};
/*****************************
UserConfigLifeStyle
******************************/
function UserConfigLifeStyle() {
this.links = {};
}
UserConfigLifeStyle.prototype = {
links : null,
enabled : null,
getIsEnabled : function() {
return this.enabled;
},
setIsEnabled : function(myIsEnabled) {
this.enabled = myIsEnabled;
},
getLinks : function() {
return this.links;
},
setLinks : function(myLinks) {
this.links = myLinks;
},
addLink : function(newLink) {
this.links[newLink] = "true";
},
getLinkByID : function(linkID) {
return links[linkID];
}
};